<template>
  <div>
    <!-- 三级联动全局组件 -->
    <TypeNav></TypeNav>
    <!--列表-->
    <ListContainer></ListContainer>
    <!--今日推荐-->
    <Recommend></Recommend>
    <!-- 商品排行 -->
    <Rank></Rank>
    <!-- 猜你喜欢 -->
    <Like></Like>
    <!--楼层-->
    <Floor :list="floorList"></Floor>
    <!--商标-->
    <Brand></Brand>
  </div>
</template>

<script>
import {mapState} from 'vuex'

import ListContainer from "@/views/Home/ListContainer";
import Recommend from "@/views/Home/Recommend";
import Rank from "@/views/Home/Rank";
import Like from "@/views/Home/Like";
import Floor from "@/views/Home/Floor";
import Brand from "@/views/Home/Brand";
export default {
  name: "",
  components: {
    ListContainer,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand
  },
  mounted(){
    //派发action，获取floor组件的数据
    this.$store.dispatch('getFloorList');
    //派发action，获取用户信息
     this.$store.dispatch('getUserInfo');
  },
   computed:{
        ...mapState({
            floorList:state=>state.home.floorList
        })
    }
};
</script>

<style>
</style>